3.302 \(\int \sqrt{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=85 \[ \frac{\sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b} \tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f}+\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f} \]

[Out]

(Sqrt[a - b]*ArcTan[(Sqrt[a - b]*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]^2]])/f + (Sqrt[b]*ArcTanh[(Sqrt[b]*Tan[
e + f*x])/Sqrt[a + b*Tan[e + f*x]^2]])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0525515, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.375, Rules used = {3661, 402, 217, 206, 377, 203} \[ \frac{\sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b} \tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f}+\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b*Tan[e + f*x]^2],x]

[Out]

(Sqrt[a - b]*ArcTan[(Sqrt[a - b]*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]^2]])/f + (Sqrt[b]*ArcTanh[(Sqrt[b]*Tan[
e + f*x])/Sqrt[a + b*Tan[e + f*x]^2]])/f

Rule 3661

Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x]
, x]}, Dist[(c*ff)/f, Subst[Int[(a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ
[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rule 402

Int[((a_) + (b_.)*(x_)^2)^(p_.)/((c_) + (d_.)*(x_)^2), x_Symbol] :> Dist[b/d, Int[(a + b*x^2)^(p - 1), x], x]
- Dist[(b*c - a*d)/d, Int[(a + b*x^2)^(p - 1)/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d,
0] && GtQ[p, 0] && (EqQ[p, 1/2] || EqQ[Denominator[p], 4])

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 377

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\sqrt{a+b x^2}}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a-b) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right ) \sqrt{a+b x^2}} \, dx,x,\tan (e+f x)\right )}{f}+\frac{b \operatorname{Subst}\left (\int \frac{1}{\sqrt{a+b x^2}} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a-b) \operatorname{Subst}\left (\int \frac{1}{1-(-a+b) x^2} \, dx,x,\frac{\tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f}+\frac{b \operatorname{Subst}\left (\int \frac{1}{1-b x^2} \, dx,x,\frac{\tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f}\\ &=\frac{\sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b} \tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f}+\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a+b \tan ^2(e+f x)}}\right )}{f}\\ \end{align*}

Mathematica [C]  time = 0.798255, size = 203, normalized size = 2.39 \[ \frac{-i \sqrt{a-b} \log \left (-\frac{4 i \left (\sqrt{a-b} \sqrt{a+b \tan ^2(e+f x)}+a-i b \tan (e+f x)\right )}{(a-b)^{3/2} (\tan (e+f x)+i)}\right )+i \sqrt{a-b} \log \left (\frac{4 i \left (\sqrt{a-b} \sqrt{a+b \tan ^2(e+f x)}+a+i b \tan (e+f x)\right )}{(a-b)^{3/2} (\tan (e+f x)-i)}\right )+2 \sqrt{b} \log \left (\sqrt{b} \sqrt{a+b \tan ^2(e+f x)}+b \tan (e+f x)\right )}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b*Tan[e + f*x]^2],x]

[Out]

((-I)*Sqrt[a - b]*Log[((-4*I)*(a - I*b*Tan[e + f*x] + Sqrt[a - b]*Sqrt[a + b*Tan[e + f*x]^2]))/((a - b)^(3/2)*
(I + Tan[e + f*x]))] + I*Sqrt[a - b]*Log[((4*I)*(a + I*b*Tan[e + f*x] + Sqrt[a - b]*Sqrt[a + b*Tan[e + f*x]^2]
))/((a - b)^(3/2)*(-I + Tan[e + f*x]))] + 2*Sqrt[b]*Log[b*Tan[e + f*x] + Sqrt[b]*Sqrt[a + b*Tan[e + f*x]^2]])/
(2*f)

________________________________________________________________________________________

Maple [B]  time = 0., size = 169, normalized size = 2. \begin{align*}{\frac{1}{f}\sqrt{b}\ln \left ( \sqrt{b}\tan \left ( fx+e \right ) +\sqrt{a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2}} \right ) }-{\frac{1}{fb \left ( a-b \right ) }\sqrt{{b}^{4} \left ( a-b \right ) }\arctan \left ({ \left ( a-b \right ){b}^{2}\tan \left ( fx+e \right ){\frac{1}{\sqrt{{b}^{4} \left ( a-b \right ) }}}{\frac{1}{\sqrt{a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2}}}}} \right ) }+{\frac{a}{f{b}^{2} \left ( a-b \right ) }\sqrt{{b}^{4} \left ( a-b \right ) }\arctan \left ({ \left ( a-b \right ){b}^{2}\tan \left ( fx+e \right ){\frac{1}{\sqrt{{b}^{4} \left ( a-b \right ) }}}{\frac{1}{\sqrt{a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2}}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e)^2)^(1/2),x)

[Out]

1/f*b^(1/2)*ln(b^(1/2)*tan(f*x+e)+(a+b*tan(f*x+e)^2)^(1/2))-1/f*(b^4*(a-b))^(1/2)/b/(a-b)*arctan(b^2*(a-b)/(b^
4*(a-b))^(1/2)/(a+b*tan(f*x+e)^2)^(1/2)*tan(f*x+e))+1/f*a*(b^4*(a-b))^(1/2)/b^2/(a-b)*arctan(b^2*(a-b)/(b^4*(a
-b))^(1/2)/(a+b*tan(f*x+e)^2)^(1/2)*tan(f*x+e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e)^2)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.16394, size = 1046, normalized size = 12.31 \begin{align*} \left [\frac{\sqrt{b} \log \left (2 \, b \tan \left (f x + e\right )^{2} + 2 \, \sqrt{b \tan \left (f x + e\right )^{2} + a} \sqrt{b} \tan \left (f x + e\right ) + a\right ) + \sqrt{-a + b} \log \left (-\frac{{\left (a - 2 \, b\right )} \tan \left (f x + e\right )^{2} + 2 \, \sqrt{b \tan \left (f x + e\right )^{2} + a} \sqrt{-a + b} \tan \left (f x + e\right ) - a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, f}, \frac{2 \, \sqrt{a - b} \arctan \left (-\frac{\sqrt{b \tan \left (f x + e\right )^{2} + a}}{\sqrt{a - b} \tan \left (f x + e\right )}\right ) + \sqrt{b} \log \left (2 \, b \tan \left (f x + e\right )^{2} + 2 \, \sqrt{b \tan \left (f x + e\right )^{2} + a} \sqrt{b} \tan \left (f x + e\right ) + a\right )}{2 \, f}, -\frac{2 \, \sqrt{-b} \arctan \left (\frac{\sqrt{b \tan \left (f x + e\right )^{2} + a} \sqrt{-b}}{b \tan \left (f x + e\right )}\right ) - \sqrt{-a + b} \log \left (-\frac{{\left (a - 2 \, b\right )} \tan \left (f x + e\right )^{2} + 2 \, \sqrt{b \tan \left (f x + e\right )^{2} + a} \sqrt{-a + b} \tan \left (f x + e\right ) - a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, f}, \frac{\sqrt{a - b} \arctan \left (-\frac{\sqrt{b \tan \left (f x + e\right )^{2} + a}}{\sqrt{a - b} \tan \left (f x + e\right )}\right ) - \sqrt{-b} \arctan \left (\frac{\sqrt{b \tan \left (f x + e\right )^{2} + a} \sqrt{-b}}{b \tan \left (f x + e\right )}\right )}{f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e)^2)^(1/2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(b)*log(2*b*tan(f*x + e)^2 + 2*sqrt(b*tan(f*x + e)^2 + a)*sqrt(b)*tan(f*x + e) + a) + sqrt(-a + b)*l
og(-((a - 2*b)*tan(f*x + e)^2 + 2*sqrt(b*tan(f*x + e)^2 + a)*sqrt(-a + b)*tan(f*x + e) - a)/(tan(f*x + e)^2 +
1)))/f, 1/2*(2*sqrt(a - b)*arctan(-sqrt(b*tan(f*x + e)^2 + a)/(sqrt(a - b)*tan(f*x + e))) + sqrt(b)*log(2*b*ta
n(f*x + e)^2 + 2*sqrt(b*tan(f*x + e)^2 + a)*sqrt(b)*tan(f*x + e) + a))/f, -1/2*(2*sqrt(-b)*arctan(sqrt(b*tan(f
*x + e)^2 + a)*sqrt(-b)/(b*tan(f*x + e))) - sqrt(-a + b)*log(-((a - 2*b)*tan(f*x + e)^2 + 2*sqrt(b*tan(f*x + e
)^2 + a)*sqrt(-a + b)*tan(f*x + e) - a)/(tan(f*x + e)^2 + 1)))/f, (sqrt(a - b)*arctan(-sqrt(b*tan(f*x + e)^2 +
 a)/(sqrt(a - b)*tan(f*x + e))) - sqrt(-b)*arctan(sqrt(b*tan(f*x + e)^2 + a)*sqrt(-b)/(b*tan(f*x + e))))/f]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a + b \tan ^{2}{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e)**2)**(1/2),x)

[Out]

Integral(sqrt(a + b*tan(e + f*x)**2), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{b \tan \left (f x + e\right )^{2} + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e)^2)^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(b*tan(f*x + e)^2 + a), x)